package com.qianfeng.biquge.mapper;

import com.qianfeng.biquge.pojo.Authors;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

public interface AuthorMapper {


    void addAuthor(Authors authors);

    @Select("select * from authors")
    List<Authors> getAllAuthor();

    @Select("select * from authors where authorid=#{authorId} ")
    Authors getAuthorByAuthorId(Long authorId);

    @Select("select * from authors where authorname like concat('%',#{authorName} ,'%') ")
    List<Authors> getAuthorByAuthorName(String authorName);

    int updateAuthor(Authors authors);

}
